item[0]: (i + 1) 2 for i, item in (sort_loc)

26

def double_stuff(a_list):
    """ Overwrite each element in a_list with double its value. """
    for (idx, val) in enumerate(a_list):
        a_list[idx] = 2 * val

things = [2, 5, 9]
double_stuff(things)
print(things)

Comments

Submit
0 Comments